<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<!-- saved from url=(0057)http://demo.cssmoban.com/cssthemes4/amz_17_bef/index.html -->
<html class="am-touch js cssanimations"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/amazeui.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/wap.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/bootstrap.min.css" />
    <script src="${pageContext.request.contextPath}/static/js/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/bootstrap.min.js"></script>
	<script src="${pageContext.request.contextPath}/static/js/amazeui.min.js"></script>
    <title>首页</title>
    
<style>

	#top{
		margin:0px auto 50px auto;
	}
	.container{
		font-size: 26px;
		line-height: 50px;
		text-align: center;
		background-color: #E0FFFF;
		height:50px;
	}
	.container .nav{
		margin:auto;
	}
	
	.container .nav li{
		width:50%;
		text-align: center;
		float:left;
	}
	
	.container .nav li a{
		display:inline-block;
		width:100%;
		height:100%;
		line-height: 30px;
	}

.flow{
		float:left;
		width:48%;
		margin:3px;
		padding:5px;
		background:#FFFFF0;
	} 
	.flow div{
		border-color: white;
	}

</style>
</head>
<body>

<nav class="navbar navbar-fixed-bottom">
  <div class="container">
    <!-- Collect the nav links, forms, and other content for toggling -->
    
      <ul class="nav navbar-nav" style="width:100%;height:100%;">
        <li style="height:100%;border-right:2px solid #7EC0EE;" class="active"><a href="${pageContext.request.contextPath}/image/phone/index">首页</a></li>
        <li style="height:100%"><a href="${pageContext.request.contextPath}/image/phone/contact">联系方式</a></li>
      </ul>
      
   
  </div><!-- /.container-fluid -->
</nav>

<div data-am-widget="gotop" class="am-gotop am-gotop-fixed am-no-layout" style="margin-bottom: 50px;">
    <a href="#top" title="">
        <img class="am-gotop-icon-custom" src="${pageContext.request.contextPath}/static/img/goTop.png">
    </a>
</div>

<div class="pet_mian" id="top">
		<div data-am-widget="slider"
			class="am-slider am-slider-a1 am-no-layout"
			data-am-slider="{&quot;directionNav&quot;:false}">

			<div class="am-viewport"
				style="overflow: hidden; position: relative;">
				<ul class="am-slides"
					style="width: 100%; transition-duration: 0s; transform: translate3d(-1920px, 0px, 0px);">
					<li class="clone" aria-hidden="true"
						style="width: 640px; float: left; display: block;"><img
						src="${pageContext.request.contextPath}/static/img/img1.jpg" draggable="false">
						<div class="pet_slider_font">
							<span class="pet_slider_emoji"> (｡・`ω´･) </span> <span>防盗门窗</span>
						</div>
						<div class="pet_slider_shadow"></div></li>
					<li style="width: 640px; float: left; display: block;" class="">
						<img src="${pageContext.request.contextPath}/static/img/img2.jpg" draggable="false" >
						<div class="pet_slider_font">
							<span class="pet_slider_emoji"> (╭￣3￣)╭♡ </span> <span>铁艺</span>
						</div>
						<div class="pet_slider_shadow"></div>
					</li>
					<li class="" style="width: 640px; float: left; display: block;">
						<img src="${pageContext.request.contextPath}/static/img/img3.jpg" draggable="false">
						<div class="pet_slider_font">
							<span class="pet_slider_emoji"> []~(￣▽￣)~* </span> <span>铁艺扶手平台</span>
						</div>
						<div class="pet_slider_shadow"></div>
					</li>
					<%-- <li style="width: 640px; float: left; display: block;"
						class="am-active-slide"><img src="${pageContext.request.contextPath}/static/img/img4.jpg"
						draggable="false">
						<div class="pet_slider_font">
							<span class="pet_slider_emoji"> (｡・`ω´･) </span> <span>铁艺门花隔断</span>
						</div>
						<div class="pet_slider_shadow"></div></li> --%>
					<li style="width: 640px; float: left; display: block;"
						class="clone" aria-hidden="true"><img
						src="${pageContext.request.contextPath}/static/img/img5.jpg" draggable="false">
						<div class="pet_slider_font">
							<span class="pet_slider_emoji"> (╭￣3￣)╭♡ </span> <span>铁艺围栏</span>
						</div>
						<div class="pet_slider_shadow"></div></li>
					<li style="width: 640px; float: left; display: block;"
						class="clone" aria-hidden="true"><img
						src="${pageContext.request.contextPath}/static/img/img6.jpg" draggable="false">
						<div class="pet_slider_font">
							<span class="pet_slider_emoji"> (╭￣3￣)╭♡ </span> <span>铁艺小门</span>
						</div>
						<div class="pet_slider_shadow"></div></li>
				</ul>
			</div>
			
		</div>


		<div class="pet_circle_nav">
			<ul id="tagUls" class="pet_circle_nav_list" role="tablist">
				<li><a
					href="#fdmc" aria-controls="fdmc" style="text-decoration: none;" role="tab" data-toggle="tab"
					class="iconfont pet_nav_xinxianshi "></a><span>防盗门窗</span></li>
				<li><a
					href="#ty" aria-controls="ty" style="text-decoration: none;" role="tab" data-toggle="tab"
					class="iconfont pet_nav_zhangzhishi "></a><span>铁艺</span></li>
				<li><a
					href="#tyfspt" aria-controls="tyfspt" style="text-decoration: none;" role="tab" data-toggle="tab"
					class="iconfont pet_nav_mengzhuanti "></a><span>扶手平台</span></li>
				<li><a
					href="#tymhgd" aria-controls="tymhgd" style="text-decoration: none;" role="tab" data-toggle="tab"
					class="iconfont pet_nav_meirong "></a><span>门花隔断</span></li>
				<li><a
					href="#tywl" aria-controls="tywl" style="text-decoration: none;" role="tab" data-toggle="tab"
					class="iconfont pet_nav_yiyuan "></a><span>围栏</span></li>
				<li><a href="#tyxm" aria-controls="tyxm" style="text-decoration: none;" role="tab" data-toggle="tab"
					class="iconfont pet_nav_gengduo "></a><span>小门</span></li>
			</ul>

		</div>
		
		
	<div class="tab-content">
	    <div role="tabpanel" class="tab-pane active" id="fdmc">
	    	<div class="flow" >
				<c:forEach items="${data.fdmc}" var="fdmc" begin="0" step="2" end="8">
		    		<div style="width:99%;background:#159;margin:5px auto;">
		    			<img src="${pageContext.request.contextPath}/static/images/fdmc/${fdmc}" style="width:100%;height:auto;">
		    		</div>
		    	</c:forEach>
			</div> 
			<div class="flow" >
				<c:forEach items="${data.fdmc}" var="fdmc" begin="1" step="2" end="8">
		    		<div style="width:99%;background:#159;margin:5px auto;">
		    			<img src="${pageContext.request.contextPath}/static/images/fdmc/${fdmc}" style="width:100%;height:auto;">
		    		</div>
		    	</c:forEach>
			</div> 
	    </div>
	    <div role="tabpanel" class="tab-pane" id="ty">
			<div class="flow" >
				<c:forEach items="${data.ty}" var="ty" begin="0" step="2" end="8">
		    		<div style="width:99%;background:#159;margin:5px auto;">
		    			<img src="${pageContext.request.contextPath}/static/images/ty/${ty}" style="width:100%;height:auto;">
		    		</div>
		    	</c:forEach>
			</div> 
			<div class="flow" >
				<c:forEach items="${data.ty}" var="ty" begin="1" step="2" end="8">
		    		<div style="width:99%;background:#159;margin:5px auto;">
		    			<img src="${pageContext.request.contextPath}/static/images/ty/${ty}" style="width:100%;height:auto;">
		    		</div>
		    	</c:forEach>
			</div>
		</div>
	    <div role="tabpanel" class="tab-pane" id="tyfspt">
			<div class="flow" >
				<c:forEach items="${data.tyfspt}" var="tyfspt" begin="0" step="2" end="8">
		    		<div style="width:99%;background:#159;margin:5px auto;">
		    			<img src="${pageContext.request.contextPath}/static/images/tyfspt/${tyfspt}" style="width:100%;height:auto;">
		    		</div>
		    	</c:forEach>
			</div> 
			<div class="flow" >
				<c:forEach items="${data.tyfspt}" var="tyfspt" begin="1" step="2" end="8">
		    		<div style="width:99%;background:#159;margin:5px auto;">
		    			<img src="${pageContext.request.contextPath}/static/images/tyfspt/${tyfspt}" style="width:100%;height:auto;">
		    		</div>
		    	</c:forEach>
			</div>
		</div>
	    <div role="tabpanel" class="tab-pane" id="tymhgd">
			<div class="flow" >
				<c:forEach items="${data.tymhgd}" var="tymhgd" begin="0" step="2" end="8">
		    		<div style="width:99%;background:#159;margin:5px auto;">
		    			<img src="${pageContext.request.contextPath}/static/images/tymhgd/${tymhgd}" style="width:100%;height:auto;">
		    		</div>
		    	</c:forEach>
			</div> 
			<div class="flow" >
				<c:forEach items="${data.tymhgd}" var="tymhgd" begin="1" step="2" end="8">
		    		<div style="width:99%;background:#159;margin:5px auto;">
		    			<img src="${pageContext.request.contextPath}/static/images/tymhgd/${tymhgd}" style="width:100%;height:auto;">
		    		</div>
		    	</c:forEach>
			</div>
		</div>
		<div role="tabpanel" class="tab-pane" id="tywl">
			<div class="flow" >
				<c:forEach items="${data.tywl}" var="tywl" begin="0" step="2" end="8">
		    		<div style="width:99%;background:#159;margin:5px auto;">
		    			<img src="${pageContext.request.contextPath}/static/images/tywl/${tywl}" style="width:100%;height:auto;">
		    		</div>
		    	</c:forEach>
			</div> 
			<div class="flow" >
				<c:forEach items="${data.tywl}" var="tywl" begin="1" step="2" end="8">
		    		<div style="width:99%;background:#159;margin:5px auto;">
		    			<img src="${pageContext.request.contextPath}/static/images/tywl/${tywl}" style="width:100%;height:auto;">
		    		</div>
		    	</c:forEach>
			</div> 
		</div>
		<div role="tabpanel" class="tab-pane" id="tyxm">
			<div class="flow" >
				<c:forEach items="${data.tyxm}" var="tyxm" begin="0" step="2" end="8">
		    		<div style="width:99%;background:#159;margin:5px auto;">
		    			<img src="${pageContext.request.contextPath}/static/images/tyxm/${tyxm}" style="width:100%;height:auto;">
		    		</div>
		    	</c:forEach>
			</div> 
			<div class="flow" >
				<c:forEach items="${data.tyxm}" var="tyxm" begin="1" step="2" end="8">
		    		<div style="width:99%;background:#159;margin:5px auto;">
		    			<img src="${pageContext.request.contextPath}/static/images/tyxm/${tyxm}" style="width:100%;height:auto;">
		    		</div>
		    	</c:forEach>
			</div> 
		</div>
	  </div>
		<div style="clear:both;"></div>
	</div>

<script>
$(function(){
	(function(){
		var curImg = 9;//当前图片编号
		var tatolImg = 0; //当前分类图片总数
		var list = [];//图片集合
		var curTag = "fdmc";
		var newImg = null;
		var datas = null;
		
		//获取数据
		function getData(){
			$.ajax({
				url:"${pageContext.request.contextPath}/image/getAllFiles",
				type:"post",
				async:false,
				dataType:"json",
				success:function(data){
					datas = data;
				}
			});
		}
		
		$("#tagUls").find("a").click(function(){
			var tagId = $(this).attr("aria-controls");
			curTag = tagId;
			curImg = $("#"+tagId).find("img").length;
			tatolImg = datas[tagId].length;
			list = datas[tagId];
			
			/* $.ajax({
				url:"${pageContext.request.contextPath}/image/getImages",
				type:"post",
				data:{"filePath":tagId},
				async:false,
				dataType:"json",
				success:function(data){
					curImg = 0;
					tatolImg = data.length;
					list = data;
				}
			}) */
			
		});
		$(document).ready(function(){ 
			
			getData();//获取数据
			
			$("#tagUls").find("a")[0].click();
			
			$(window).scroll(function(){ 
				// 被卷去的高度 
				var scrollTop = document.body.scrollTop||document.documentElement.scrollTop; 
				// 页面高度 
				var pageHeight = $(document).height(); 
				// 可视区域高度 
				var viewHeight = $(window).height(); 
				//alert(viewHeight); 
				//当滚动到底部时 
				if((scrollTop+viewHeight)>(pageHeight-20)){ 
					if(curImg < tatolImg){//防止无限制的增长 
						for(var i = 0 ; i < 2 ; i++){ 
							loadImage(curTag);
						} 
					} 
				} 
			}); 
		});
		
		//加载图片
		function loadImage(tagId){
			var preUrl = "${pageContext.request.contextPath}/static/images/"+curTag+"/";
			var flowList = $("#"+tagId).find(".flow");
			
			if(curImg < tatolImg){
				var _div = "<div style=\"width:99%;background:#159;margin:5px auto;\"><img src='"+preUrl+list[curImg++]+"' style=\"width:100%;height:auto;\"></div>";
				newImg = $(_div).children();
				$(newImg).load(function(){
					var minHeight = $(flowList[0]).height();
					var minFlow = flowList[0];
					for(var i = 0;i<flowList.length;i++){
						if($(flowList[i]).height() < minHeight){
							minHeight = $(flowList[i]).height();
							minFlow = flowList[i];
						}
					}
					$(minFlow).append(_div); 				
				})
			}
		}
	
	})();
   
});

</script>

</body>
</html>